diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-09-20 16:38:54 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-09-20 16:38:54 +0200 |
| commit | f861e6a269ba9f62700776d3cd13b644a9e836d4 (patch) | |
| tree | a5a107e7a6e4ff8b4261fe04349357bc00b783ee /src/pages/article/[slug].tsx | |
| parent | 03331c44276ec56e9f235e4d5ee75030455a753f (diff) | |
refactor: use named export for everything except pages
Next expect a default export for pages so only those components should
use default exports. Everything else should use named exports to
reduce the number of import statements.
Diffstat (limited to 'src/pages/article/[slug].tsx')
| -rw-r--r-- | src/pages/article/[slug].tsx | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index dae89fb..f564f35 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -5,41 +5,43 @@ import Script from 'next/script'; import { ParsedUrlQuery } from 'querystring'; import { HTMLAttributes } from 'react'; import { useIntl } from 'react-intl'; -import ButtonLink from '../../components/atoms/buttons/button-link'; -import Link from '../../components/atoms/links/link'; -import Spinner from '../../components/atoms/loaders/spinner'; -import ResponsiveImage from '../../components/molecules/images/responsive-image'; -import Sharing from '../../components/organisms/widgets/sharing'; -import { getLayout } from '../../components/templates/layout/layout'; -import PageLayout, { +import { + ButtonLink, + getLayout, + Link, + PageLayout, type PageLayoutProps, -} from '../../components/templates/page/page-layout'; + ResponsiveImage, + Sharing, + Spinner, +} from '../../components'; import { getAllArticlesSlugs, + getAllComments, getArticleBySlug, -} from '../../services/graphql/articles'; -import { getAllComments } from '../../services/graphql/comments'; +} from '../../services/graphql'; import styles from '../../styles/pages/article.module.scss'; import { type Article, type NextPageWithLayout, type SingleComment, -} from '../../types/app'; -import { loadTranslation, type Messages } from '../../utils/helpers/i18n'; +} from '../../types'; import { getBlogSchema, getSchemaJson, getSinglePageSchema, getWebPageSchema, -} from '../../utils/helpers/schema-org'; -import useArticle from '../../utils/hooks/use-article'; -import useBreadcrumb from '../../utils/hooks/use-breadcrumb'; -import useComments from '../../utils/hooks/use-comments'; -import usePrism, { +} from '../../utils/helpers'; +import { loadTranslation, type Messages } from '../../utils/helpers/server'; +import { type OptionalPrismPlugin, -} from '../../utils/hooks/use-prism'; -import useReadingTime from '../../utils/hooks/use-reading-time'; -import useSettings from '../../utils/hooks/use-settings'; + useArticle, + useBreadcrumb, + useComments, + usePrism, + useReadingTime, + useSettings, +} from '../../utils/hooks'; type ArticlePageProps = { comments: SingleComment[]; |
